<?php
			ob_start();
	        require_once("../includes/initialize.php");
			require_once("../includes/file.php");
			
			openConnection();			
?>
<?php
		
		if (isset($_COOKIE["user"])) {
			// if cookie <> ""
		  }
		  else
		  {
			  pageRedirect("login.php","");
			  
		  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/mainstyle.css" rel="stylesheet" type="text/css"  />
<link href="css/style_header.css" rel="stylesheet" type="text/css"  />
<link href="css/form_css.css" rel="stylesheet" type="text/css"  />
<title>Eretsprotection</title>
<script language="JavaScript" src="js/script.js"></script>
</head>
<body>
<div align="center">
	<div class="container" align="left">
    	<div class="header">
        	<?php 
				require_once('include/header.php');
			?>
        </div><!--end header -->
        <div id="log_out"> 
                	<a href="logoff.php" style="text-align:center; float:right; font-family:Arial, Helvetica, sans-serif; display:block; width:100px;height:20px; padding:0px; margin-right:0px; background-color:#000; text-decoration:none;font-weight:normal">
                	Déconnexion</a>
        </div>
        <div style="clear:both;"></div>
        <div class="wrapper">
        	
            <div class="wrapper_right">
            	<div class="content">
                     <?php 
						if(isset($_GET['page']) && $_GET['page'] != ''){
							if(file_exists($_GET['page'].".php")){
								include($_GET['page'].".php");
								$page=$_GET['page'].".php";
							}else{
								include("product.php");
								$page=$_GET['page'].".php";
							}
						}else{
							include("product.php");
							$page="product.php";
						}
					?>
                </div>
            </div><!--end wrapper_right -->
            <div class="sidebar_left">
            	<div id="menu">
            	<?php 
					//require_once('include/left.php');
					//set current cusor
					switch ($page) {
						case "product.php":
							$product="class=current";
							@$category="";
							@$actuality="";
							@$newsletter="";
							@$contact="";
							@$gallery="";
							@$user="";
							break;
						case "category.php":
							@$product="";
							$category="class=current";
							@$actuality="";
							@$newsletter="";
							@$contact="";
							@$gallery="";
							@$user="";
							break;
						case "actuality.php":
							@$product="";
							$category="";
							@$actuality="class=current";
							@$newsletter="";
							@$contact="";
							@$gallery="";
							@$user="";
							break;
						case "newsletter.php":
							@$product="";
							@$category="";
							@$actuality="";
							$newsletter="class=current";
							@$contact="";
							@$gallery="";
							@$user="";
							break;
						case "contact.php":
							@$product="";
							@$category="";
							@$actuality="";
							@$newsletter="";
							$contact="class=current";
							@$gallery="";
							@$user="";
							break;
						case "gallery.php":
							@$product="";
							@$category="";
							@$actuality="";
							@$newsletter="";
							@$contact="";
							$gallery="class=current";
							@$user="";
							break;
						case "user.php":
							@$product="";
							@$category="";
							@$actuality="";
							@$newsletter="";
							@$contact="";
							@$gallery="";
							$user="class=current";
							break;
					}
				?>
                <ul>
                    <li><a href="index.php?page=product"<?php echo @$product;?> >gestion des produits</a></li>
                    <li><a href="index.php?page=category"<?php echo @$category;?>>gestion des catégories</a></li>
                     <li><a href="index.php?page=actuality"<?php echo @$actuality;?>>gestion des actualité</a></li>
                    <li><a href="index.php?page=newsletter"<?php echo @$newsletter;?>>gestion des bulletin</a></li>
                    <li><a href="index.php?page=contact"<?php echo @$contact;?>>gestion des contacts</a></li>
                    <li><a href="index.php?page=user"<?php echo @$user;?>>gestion des utilisateurs</a></li>
                </ul>
                </div>
            </div><!--end sclassebar_left -->
        </div><!--end wrapper -->
    </div><!--end container -->
</div><!--end center -->
<div class="footer">
        	<div class="footer_text">
                V9D Draco co,.ltd
            </div>
</div><!--end footer -->
</body>
</html>
<?php
	closeConnection();
?>